#include "GUI.h"
#include "WM.h"


static void cb_back(WM_MESSAGE *pMsg)
{
	WM_HWIN hWin = pMsg->hWin;
	
	switch(pMsg->MsgId)
	{
		case WM_PAINT:
		{
			GUI_SetBkColor(GUI_WHITE);
			GUI_Clear();
			
			break;
		}
		
		
	}
}

static void cb_win(WM_MESSAGE *pMsg)
{
	WM_HWIN hWin = pMsg->hWin;
	
	switch(pMsg->MsgId)
	{
		case WM_PAINT:
		{
			GUI_SetBkColor(GUI_BLACK);
			GUI_Clear();
			
			GUI_SetColor(GUI_WHITE);
			GUI_SetTextMode(GUI_TEXTMODE_TRANS);
			GUI_SetFont(GUI_FONT_16_ASCII);
			GUI_DispStringHCenterAt("Hello YC\n 2017.09.24", 64, 0);
			
			break;
		}
		
		
	}
}

void GUI_Main(void)
{
	GUI_Init();
	
	WM_SetCallback(WM_HBKWIN, cb_back);
	
	WM_CreateWindowAsChild(0,0,128,32, WM_HBKWIN, WM_CF_SHOW, cb_win, 0);

	while(1)
	{
		GUI_Delay(10);
	}
	
}




